Repository navigation
Declare the project version in CMake and generate a version header - #561
Open
paceholder wants to merge 4 commits into
Open
paceholder wants to merge 4 commits into
paceholder wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
The library had no version in its sources. The only version was the git tag, so a copy without
.git(a zip download, vendored files) could not tell its version.docs/conf.pystill saidrelease = '3.0'. There was also no way to ask for a version withfind_packageor#if.The version is now written once, in
project()ofCMakeLists.txt. Everything else comes from it.Commits, each builds and passes on its own:
Declare the project version and install a package version file.project(QtNodesLibrary VERSION 3.2.1 LANGUAGES CXX). It installsQtNodesConfigVersion.cmakewithSameMajorVersion, sofind_package(QtNodes 3.1)accepts 3.2.1 andfind_package(QtNodes 4.0)rejects it. It also setsVERSIONandSOVERSIONon the target.Generate a version header from the project version.QtNodes/VersiondefinesQTNODES_VERSION_MAJOR,_MINOR,_PATCH,QTNODES_VERSION_STR,QTNODES_VERSION_CHECK(a, b, c)andQTNODES_VERSION. The header is generated into the build directory and installed.Test the generated version macros.Take the docs version from the project version.docs/conf.pyreads the version fromCMakeLists.txt. Doxygen getsPROJECT_NUMBERfromPROJECT_VERSION.To release: change the number in
project(), commit, and create the tag. Between releasesmastershows the last released version.Shared builds now get
SOVERSIONequal to the major version. On Linux the library file becomeslibQtNodes.so.3with alibQtNodes.solink. Static and Windows builds are not affected.Testing
cmake --install, thenfind_package(QtNodes 3.1 REQUIRED)finds 3.2.1 andfind_package(QtNodes 4.0 REQUIRED)reports an incompatible version. The installedVersion.hppis present. The regex inconf.pyreturns3.2.1.Breaking changes?
No.
Related issue
Part of the release housekeeping. Found while answering #464, where the reporter could not tell which version he had.